<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-3.7.1.min.js"></script>
    <style>
        div{
          width: 200px;
          height: 200px;
          margin: 10px;
          padding: 20px;
          border: 10px solid green;
          background-color: red;
         }
      </style>

      <script>
        //或一个div的宽度高度+padding+border
         var height=$(".box").outerHeight();
         var width=$(".box").outerWidth();
         console.log(height.width);//
         
      </script>
</head>
<body>
    
</body>
</html>